<?php

namespace App\Admin\Models;

use Illuminate\Database\Eloquent\Model;

use Ixudra\Curl\Facades\Curl;

use Illuminate\Support\MessageBag;

class BaseModel extends Model
{
	//自动维护时间戳
    public $timestamps = false;
    
    public $host;
    
    function __construct() {
	    $this->host = config('admin.dataApiHost');
    }
	
	public function handelApiData($jsonData){
		
		$data = json_decode($jsonData, true);
		if (!$data){
			echo $jsonData;
			exit;
		}
		if ($data['code'] === 1){
			return $data['data'];
		}else{
			echo $data['msg'];
			exit;
		}
	}
}
